/**
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.oa.model;

import java.util.Date;


import com.legendshop.dao.persistence.Column;
import com.legendshop.dao.persistence.Entity;
import com.legendshop.dao.persistence.GeneratedValue;
import com.legendshop.dao.persistence.GenerationType;
import com.legendshop.dao.persistence.Id;
import com.legendshop.dao.persistence.Table;
import com.legendshop.dao.persistence.TableGenerator;
import com.legendshop.dao.persistence.Transient;
import com.legendshop.dao.support.GenericEntity;

/**
 * 用户访问历史对象.
 */
@Entity
@Table(name = "ls_vit_log")
public class VisitLog implements GenericEntity<Long> {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -6138702495183168329L;

	/** The visit id. */
	private Long visitId;

	/** The ip. */
	private String ip;

	/** The country. */
	private String country;

	/** The area. */
	private String area;

	/** The user name. */
	private String userName;

	/** The shop name. */
	private String shopName;

	/** The product name. */
	private String productName;

	/** The product id. */
	private Long productId;

	/** The page. */
	private String page;

	/** The date. */
	private Date date;

	/** The visit num. */
	private Integer visitNum;

	/** The start time. */
	private Date startTime;

	/** The end time. */
	private Date endTime;
	
	/** 店铺Id **/
	private Long shopId;
	
	/** 访问来源 **/
	private String source;
	
	private String nickName;
	
	private String portrait;

	/**
	 * Gets the start time.
	 * 
	 * @return the start time
	 */
	@Transient
	public Date getStartTime() {
		return startTime;
	}

	/**
	 * Sets the start time.
	 * 
	 * @param startTime
	 *            the new start time
	 */
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	/**
	 * Gets the end time.
	 * 
	 * @return the end time
	 */
	@Transient
	public Date getEndTime() {
		return endTime;
	}

	/**
	 * Sets the end time.
	 * 
	 * @param endTime
	 *            the new end time
	 */
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	/**
	 * Instantiates a new visit log.
	 */
	public VisitLog() {
	}

	/**
	 * Instantiates a new visit log.
	 * 
	 * @param ip
	 *            the ip
	 * @param page
	 *            the page
	 * @param date
	 *            the date
	 */
	public VisitLog(String ip, String page, Date date) {
		this.ip = ip;
		this.page = page;
		this.date = date;
	}

	/**
	 * full constructor.
	 * 
	 * @param ip
	 *            the ip
	 * @param country
	 *            the country
	 * @param area
	 *            the area
	 * @param userName
	 *            the user name
	 * @param shopName
	 *            the shop name
	 * @param productName
	 *            the product name
	 * @param page
	 *            the page
	 * @param date
	 *            the date
	 */
	public VisitLog(String ip, String country, String area, String userName, String shopName, String productName,
			String page, Date date) {
		this.ip = ip;
		this.country = country;
		this.area = area;
		this.userName = userName;
		this.shopName = shopName;
		this.productName = productName;
		this.page = page;
		this.date = date;
	}

	/**
	 * Gets the visit id.
	 * 
	 * @return the visit id
	 */
	@Id
	@Column(name = "visit_id")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "generator")
	@TableGenerator(name = "generator", pkColumnValue = "VIT_LOG_SEQ")
	public Long getVisitId() {
		return this.visitId;
	}

	/**
	 * Sets the visit id.
	 * 
	 * @param visitId
	 *            the new visit id
	 */
	public void setVisitId(Long visitId) {
		this.visitId = visitId;
	}

	/**
	 * Gets the ip.
	 * 
	 * @return the ip
	 */
	@Column(name = "ip")
	public String getIp() {
		return this.ip;
	}

	/**
	 * Sets the ip.
	 * 
	 * @param ip
	 *            the new ip
	 */
	public void setIp(String ip) {
		this.ip = ip;
	}

	/**
	 * Gets the country.
	 * 
	 * @return the country
	 */
	@Column(name = "country")
	public String getCountry() {
		return this.country;
	}

	/**
	 * Sets the country.
	 * 
	 * @param country
	 *            the new country
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * Gets the area.
	 * 
	 * @return the area
	 */
	@Column(name = "area")
	public String getArea() {
		return this.area;
	}

	/**
	 * Sets the area.
	 * 
	 * @param area
	 *            the new area
	 */
	public void setArea(String area) {
		this.area = area;
	}

	/**
	 * Gets the user name.
	 * 
	 * @return the user name
	 */
	@Column(name = "user_name")
	public String getUserName() {
		return this.userName;
	}

	/**
	 * Sets the user name.
	 * 
	 * @param userName
	 *            the new user name
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * Gets the shop name.
	 * 
	 * @return the shop name
	 */
	@Column(name = "shop_name")
	public String getShopName() {
		return this.shopName;
	}

	/**
	 * Sets the shop name.
	 * 
	 * @param shopName
	 *            the new shop name
	 */
	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	/**
	 * Gets the product name.
	 * 
	 * @return the product name
	 */
	@Column(name = "product_name")
	public String getProductName() {
		return this.productName;
	}

	/**
	 * Sets the product name.
	 * 
	 * @param productName
	 *            the new product name
	 */
	public void setProductName(String productName) {
		this.productName = productName;
	}

	/**
	 * Gets the page.
	 * 
	 * @return the page
	 */
	@Column(name = "page")
	public String getPage() {
		return this.page;
	}

	/**
	 * Sets the page.
	 * 
	 * @param page
	 *            the new page
	 */
	public void setPage(String page) {
		this.page = page;
	}

	/**
	 * Gets the date.
	 * 
	 * @return the date
	 */
	@Column(name = "rec_date")
	public Date getDate() {
		return this.date;
	}

	/**
	 * Sets the date.
	 * 
	 * @param date
	 *            the new date
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * Gets the product id.
	 * 
	 * @return the product id
	 */
	@Column(name = "product_id")
	public Long getProductId() {
		return productId;
	}

	/**
	 * Sets the product id.
	 * 
	 * @param productId
	 *            the new product id
	 */
	public void setProductId(Long productId) {
		this.productId = productId;
	}

	/**
	 * Gets the visit num.
	 * 
	 * @return the visit num
	 */
	@Column(name = "visit_num")
	public Integer getVisitNum() {
		return visitNum;
	}

	/**
	 * Sets the visit num.
	 * 
	 * @param visitNum
	 *            the new visit num
	 */
	public void setVisitNum(Integer visitNum) {
		this.visitNum = visitNum;
	}

	@Transient
	public Long getId() {
		return visitId;
	}

	public void setId(Long id) {
		this.visitId = id;
	}

	@Column(name = "shop_id")
	public Long getShopId() {
		return shopId;
	}

	public void setShopId(Long shopId) {
		this.shopId = shopId;
	}

	@Column(name = "source")
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	@Transient
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Transient
	public String getPortrait() {
		return portrait;
	}

	public void setPortrait(String portrait) {
		this.portrait = portrait;
	}
}